// 基础咖啡类
class SimpleCoffee {
    getDescription() {
        return '普通咖啡';
    }
    
    getCost() {
        return 10.0;
    }
}

// 装饰者基类
class CoffeeDecorator {
    constructor(coffee) {
        this.coffee = coffee;
    }
    
    getDescription() {
        return this.coffee.getDescription();
    }
    
    getCost() {
        return this.coffee.getCost();
    }
}

// 具体装饰者
class MilkDecorator extends CoffeeDecorator {
    getDescription() {
        return `${this.coffee.getDescription()} + 牛奶`;
    }
    
    getCost() {
        return this.coffee.getCost() + 2.0;
    }
}

class SugarDecorator extends CoffeeDecorator {
    getDescription() {
        return `${this.coffee.getDescription()} + 糖`;
    }
    
    getCost() {
        return this.coffee.getCost() + 1.0;
    }
}

export { SimpleCoffee, MilkDecorator, SugarDecorator }; 